import React, { useState } from 'react';
import { Button, Modal } from 'antd';
import MyTable from './MyTable';
const MyModal = () => {
    const [isModalOpen, setIsModalOpen] = useState(false);
    const showModal = () => {
        setIsModalOpen(true);
    };
    const handleOk = () => {
        // 发送接口请求
        console.log('发送接口请求');
        setIsModalOpen(false);
    };
    const handleCancel = () => {
        setIsModalOpen(false);
    };
    return (
        <>
            <Button type="primary" onClick={showModal}>
                Open Modal
            </Button>
            <Modal
                width={1000}
                title="Basic Modal"
                closable={{ 'aria-label': 'Custom Close Button' }}
                open={isModalOpen}   // 控制对话框展示隐藏
                onOk={handleOk}
                onCancel={handleCancel}
            >
                <MyTable />
            </Modal>
        </>
    );
};
export default MyModal;